<?php
/**
 * CreateTime: 2022/7/8 14:32
 */

namespace App\Enum\ApprovalEnum;

use App\Enum\BaseEnumInterface;

class ApprovalRecodeEnum implements BaseEnumInterface
{
    // 正常执行任务
    const EXECUTE_TASK_NORMAL = "EXECUTE_TASK_NORMAL";
    // 代理人执行任务
    const EXECUTE_TASK_AGENT = "EXECUTE_TASK_AGENT";
    // 前加签任务
    const APPEND_TASK_BEFORE = "APPEND_TASK_BEFORE";
    // 后加签任务
    const APPEND_TASK_AFTER = "APPEND_TASK_AFTER";
    // 转交任务
    const REDIRECT_TASK = "REDIRECT_TASK";
    // 发起流程实例
    const START_PROCESS_INSTANCE = "START_PROCESS_INSTANCE";
    // 终止(撤销)流程实例
    const TERMINATE_PROCESS_INSTANCE = "TERMINATE_PROCESS_INSTANCE";
    // 结束流程实例
    const FINISH_PROCESS_INSTANCE = "FINISH_PROCESS_INSTANCE";
    // 添加评论
    const ADD_REMARK = "ADD_REMARK";
    // 审批退回
    const REDIRECT_PROCESS = "REDIRECT_PROCESS";
    // 抄送
    const PROCESS_CC = "PROCESS_CC";

    const AGREE = "AGREE";

    const REFUSE = "REFUSE";
    const NONE = "";

    public static function getEnumByEnumCode($code){
        switch ($code){
            case self::AGREE:return "同意";
            case self::REFUSE:return "拒绝";
            default:return self::NONE;
        }
    }

    public static function getEnumMeaningByEnumCode($enumCode)
    {
        switch ($enumCode){
            case self::EXECUTE_TASK_NORMAL:return "正常执行任务";
            case self::EXECUTE_TASK_AGENT:return "代理人执行任务";
            case self::APPEND_TASK_BEFORE:return "前加签任务";
            case self::APPEND_TASK_AFTER:return "后加签任务";
            case self::REDIRECT_TASK:return "转交任务";
            case self::START_PROCESS_INSTANCE:return "发起流程实例";
            case self::TERMINATE_PROCESS_INSTANCE:return "终止(撤销)流程实例";
            case self::FINISH_PROCESS_INSTANCE:return "结束流程实例";
            case self::ADD_REMARK:return "添加评论";
            case self::REDIRECT_PROCESS:return "审批退回";
            case self::PROCESS_CC:return "抄送";
            default:return self::NONE;
        }
    }


}